<?php


namespace app\api\model\wanlshop;


use think\Model;
use traits\model\SoftDelete;

class ActivityGoodsSku  extends Model
{
    use SoftDelete;

    // 表名
    protected $name = 'wanlshop_activity_goods_sku';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    public function sku()
    {
        return $this->belongsTo('GoodsSku', 'sku_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
    public function goods()
    {
        return $this->belongsTo('Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function goodssku(){
        return $this->hasMany('GoodsSku', 'goods_id', 'goods_id');
    }}